package com.ndood.spider.taobao.action;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.springframework.stereotype.Component;

import com.ndood.core.render.SeleniumDriverAction;
import com.ndood.core.util.WindowUtil;

@Component
public class TaobaoAction implements SeleniumDriverAction {

    @Override
    public void execute(WebDriver driver) {
    	try {
    		/*WebElement allcate = driver.findElement(By
    				.cssSelector(".vjs-center-start,.vjs-button"));
    		if(allcate!=null){
    			Actions action = new Actions(driver);
    			action.click(allcate).perform();
    		}*/
    		WindowUtil.loadAll(driver);
			Thread.sleep(10000);
			WebElement video = driver.findElement(By.className("vjs-center-start"));
			System.out.println(video.getTagName());;
			video.click();
			Thread.sleep(3000);
			System.out.println("hehehehehe");
    	} catch (Exception e) {
			e.printStackTrace();
		}
    }
}
